// $ANTLR 3.3 Nov 30, 2010 12:50:56 /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g 2012-03-22 10:02:22

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class PLLexer extends Lexer {
    public static final int EOF=-1;
    public static final int T__7=7;
    public static final int T__8=8;
    public static final int OP=4;
    public static final int NUM=5;
    public static final int WHITESPACE=6;

    // delegates
    // delegators

    public PLLexer() {;} 
    public PLLexer(CharStream input) {
        this(input, new RecognizerSharedState());
    }
    public PLLexer(CharStream input, RecognizerSharedState state) {
        super(input,state);

    }
    public String getGrammarFileName() { return "/home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g"; }

    // $ANTLR start "T__7"
    public final void mT__7() throws RecognitionException {
        try {
            int _type = T__7;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:3:6: ( '(' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:3:8: '('
            {
            match('('); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__7"

    // $ANTLR start "T__8"
    public final void mT__8() throws RecognitionException {
        try {
            int _type = T__8;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:4:6: ( ')' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:4:8: ')'
            {
            match(')'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__8"

    // $ANTLR start "NUM"
    public final void mNUM() throws RecognitionException {
        try {
            int _type = NUM;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:38:4: ( ( '0' .. '9' )+ )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:38:6: ( '0' .. '9' )+
            {
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:38:6: ( '0' .. '9' )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0>='0' && LA1_0<='9')) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:38:7: '0' .. '9'
            	    {
            	    matchRange('0','9'); 

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "NUM"

    // $ANTLR start "OP"
    public final void mOP() throws RecognitionException {
        try {
            int _type = OP;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:4: ( '+' | '*' | '-' | '/' | 'repeat' | 'print' | 'range' )
            int alt2=7;
            switch ( input.LA(1) ) {
            case '+':
                {
                alt2=1;
                }
                break;
            case '*':
                {
                alt2=2;
                }
                break;
            case '-':
                {
                alt2=3;
                }
                break;
            case '/':
                {
                alt2=4;
                }
                break;
            case 'r':
                {
                int LA2_5 = input.LA(2);

                if ( (LA2_5=='e') ) {
                    alt2=5;
                }
                else if ( (LA2_5=='a') ) {
                    alt2=7;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 2, 5, input);

                    throw nvae;
                }
                }
                break;
            case 'p':
                {
                alt2=6;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;
            }

            switch (alt2) {
                case 1 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:6: '+'
                    {
                    match('+'); 

                    }
                    break;
                case 2 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:12: '*'
                    {
                    match('*'); 

                    }
                    break;
                case 3 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:18: '-'
                    {
                    match('-'); 

                    }
                    break;
                case 4 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:24: '/'
                    {
                    match('/'); 

                    }
                    break;
                case 5 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:30: 'repeat'
                    {
                    match("repeat"); 


                    }
                    break;
                case 6 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:41: 'print'
                    {
                    match("print"); 


                    }
                    break;
                case 7 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:39:51: 'range'
                    {
                    match("range"); 


                    }
                    break;

            }
            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "OP"

    // $ANTLR start "WHITESPACE"
    public final void mWHITESPACE() throws RecognitionException {
        try {
            int _type = WHITESPACE;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:40:11: ( ( ' ' | '\\t' | '\\n' ) )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:40:13: ( ' ' | '\\t' | '\\n' )
            {
            if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)==' ' ) {
                input.consume();

            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;}

            skip();

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "WHITESPACE"

    public void mTokens() throws RecognitionException {
        // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:1:8: ( T__7 | T__8 | NUM | OP | WHITESPACE )
        int alt3=5;
        switch ( input.LA(1) ) {
        case '(':
            {
            alt3=1;
            }
            break;
        case ')':
            {
            alt3=2;
            }
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
            {
            alt3=3;
            }
            break;
        case '*':
        case '+':
        case '-':
        case '/':
        case 'p':
        case 'r':
            {
            alt3=4;
            }
            break;
        case '\t':
        case '\n':
        case ' ':
            {
            alt3=5;
            }
            break;
        default:
            NoViableAltException nvae =
                new NoViableAltException("", 3, 0, input);

            throw nvae;
        }

        switch (alt3) {
            case 1 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:1:10: T__7
                {
                mT__7(); 

                }
                break;
            case 2 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:1:15: T__8
                {
                mT__8(); 

                }
                break;
            case 3 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:1:20: NUM
                {
                mNUM(); 

                }
                break;
            case 4 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:1:24: OP
                {
                mOP(); 

                }
                break;
            case 5 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/05-display-parsetree/src/PL.g:1:27: WHITESPACE
                {
                mWHITESPACE(); 

                }
                break;

        }

    }


 

}